package com.jiang.booksystem.dao.mapper;


import com.jiang.booksystem.dao.entity.Book;
import com.jiang.booksystem.dao.entity.UserBookBorrow;
import com.jiang.booksystem.dao.entity.dos.UserBookBorrowAggre;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper
public interface UserBookBorrowMapper {
    /**
     * 获取数据列表
     *
     * @return List<UserBookBorrow>
     */
    List<UserBookBorrowAggre> search(@Param("bookName") String bookName);

    List<UserBookBorrowAggre> searchByUserId(@Param("userId") int userId);

    UserBookBorrow getById(@Param("id") int id);

    UserBookBorrow getByBookId(@Param("bookId")int bookId);

    UserBookBorrow getByUserId(@Param("userId")int userId);

    List<UserBookBorrow> listByUserIdAndBookId(@Param("userId") int userId, @Param("bookId") int bookId);


    int insert(@Param("userBookBorrow") UserBookBorrow userBookBorrow);

    int status(@Param("userBookBorrow")UserBookBorrow userBookBorrow);

    int returnBooks(@Param("userbookborrow") UserBookBorrow userbookborrow);
}
